<%@page import="com.google.apphosting.api.DatastorePb.GetRequest"%>
<%@page import="com.google.appengine.api.urlfetch.HTTPRequest"%>
<%@page import="main.external"%>
<%@page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8" %>
<%@ page language="java" import="captchas.CaptchasDotNet" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title></title>
<style type="text/css">
@CHARSET "UTF-8";
.reg_field
{
    margin: 5px;
    height: 55px;
    width: 350px;
}
.reg_name_field
{
    font-family: Arial, Helvetica, sans-serif;
    font-weight: bolder;
    width:auto;
    height:20px;
}
.reg_txt
{
    height:25px;
    width: 100%;
}
#reg_caption
{
    font-size: x-large;
    font-family: Arial, Helvetica, sans-serif;
    font-weight: bolder;
    font-style: normal;
    text-align: center;
    margin-top: 30px;
}
#reg_content
{
    margin-top: 20px;
    margin-right: 40px;
    margin-left: 130px;
    height: auto
}
#reg_error
{
    margin-top: 20px;
    margin-right: 40px;
    margin-left: 130px;
    height: 50px;    
    color: red;
	font-size: medium;
}
#male_div
{
    font-weight: normal;
    margin-left:15px;
    margin-right:10px;
    margin-top:10px;
    float:left;
}
#female_div
{
    font-weight: normal;
    margin-right:15px;
    margin-top:10px;
    float:left;
}
#approving_div
{    
}
#reg_sex_field
{
    margin-top: 10px;
}
</style>
</head>
<form id="reg_form" action="registration">
<div id="reg_caption">
    Регистрация
</div>
<div id="reg_error">
<%
	out.println(external.error_msg);
%>
</div> 
<div id="reg_content">
    <div class="reg_field">
        <div class="reg_name_field">
            Логин*</div>
        <input type="text" class="reg_txt" id="login_txt" name = "login" value =
        	 <% String param = request.getParameter("login");        
        		 if (param!=null)out.println("\""+param+"\"");
        		 else
        			 out.print("\"\"");
        	%>/> 
        	                            
    </div>    
    <div class="reg_field">
        <div class="reg_name_field">
            Фамилия*</div>
        <input type="text" class="reg_txt" id="sname_txt" name = "sname" value =
        	 <%  param = request.getParameter("sname");        
        		 if (param!=null)out.println("\""+param+"\"");
        		 else
        			 out.print("\"\"");
        	%>/>  
    </div>
    <div class="reg_field">
        <div class="reg_name_field">
            Имя*</div>
        <input type="text" class="reg_txt" id="name_txt" name = "name" value =
        	 <%  param = request.getParameter("name");        
        		 if (param!=null)out.println("\""+param+"\"");
        		 else
        			 out.print("\"\"");
        	%>/> 
    </div>
    <div class="reg_field">
        <div class="reg_name_field">
            Отчество</div>
        <input type="text" class="reg_txt" id="ptrnm_txt" name = "ptrnm" value =
        	 <%  param = request.getParameter("ptrnm");        
        		 if (param!=null)out.println("\""+param+"\"");
        		 else
        			 out.print("\"\"");
        	%>/>  
    </div>
    <div class="reg_field">
        <div class="reg_name_field">
            Пароль*</div>
        <input type="password" class="reg_txt" id="pswrd_txt" name = "pswrd"/> 
    </div>
    <div class="reg_field">
        <div class="reg_name_field">
            Повторите пароль*</div>
        <input type="password" class="reg_txt" id="pswrd2_txt" name = "pswrd2"/> 
    </div>
    <div class="reg_field">
        <div class="reg_name_field">
            E-mail*</div>
        <input type="text" class="reg_txt" id="email_txt" name = "email" value =
        	 <%param = request.getParameter("email");        
        		 if (param!=null)out.println("\""+param+"\"");
        		 else
        			 out.print("\"\"");
        	%>/>  
    </div>
    <div class="reg_field">
        <div class="reg_name_field">
            Пол*</div>
        <div class="reg_name_field">
            <div id="male_div">
                 Мужской
                 <input type="radio" name="sex" id="female_is" value="Male"
        	 <%  param = request.getParameter("sex");        
        		 if (param!=null && param.equals("Male"))out.println("checked=\""+param+"\"");
        		 else
        			 out.print("\"\"");
        	%>/> 
            </div>
            <div id="female_div">
                Женский
               <input type="radio" name="sex" id="male_is" value="Female" 
        	 <%  param = request.getParameter("sex");        
        		 if (param!=null && param.equals("Female"))out.println("checked=\""+param+"\"");
        		 else
        			 out.print("\"\"");
        	%>/> 
            </div>
        </div>
    </div>    
    <div class="reg_field" style="height:150px">
    	<div style="height:90px">
	    <%
			CaptchasDotNet captchas = new captchas.CaptchasDotNet(
			   request.getSession(true),     // Ensure session
			  "demo",                       // client
			  "secret"                      // secret
			  );
		%> 
        	<%= captchas.image() %>
        </div>
    	<input type="text" class="reg_txt" id="captcha" name = "captcha"/> 
    </div>
    <div class="reg_field">
       <div id="accept_div">
       	<input type="submit" name="reg_btn" value="Регистрация">              	     
       </div>
    </div>
</div> 
</form>
</html>
